package com.example.bes955_004.web.demo.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class TestController {

    static class User {
        private int id;
        private String name;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }


    }

    List list = new ArrayList();

    @PostMapping(value = "/")
    public String hello() throws InterruptedException {
        Thread.sleep(1000L);
        return "welcome to use bes application server ~~~";
    }

    @GetMapping(value = "/user")
    public void oom(){
        while(true) {
            User user = new User();
            user.setId(1);
            user.setName("a;jfdkkkkkkkkkkfjfk;ajkdf;jkjewoijfoinsflklkdsajfkjsak");
            list.add(user);
        }
    }

}


